//RWLocker.h

#pragma once

class RWLocker {
public:
	virtual void AcquireLockExclusive() = 0;
	virtual void AcquireLockShared() = 0;
	virtual void ReleaseLockExclusive() = 0;
	virtual void ReleaseLockShared() = 0;
protected:
	RWLocker() { }
};

RWLocker* CreateRWLocker();

class CriticalSectionLocker: RWLocker {
	RTL_CRITICAL_SECTION syncObj;
public:
	CriticalSectionLocker();
	~CriticalSectionLocker();
	void AcquireLockExclusive();
	void AcquireLockShared();
	void ReleaseLockExclusive();
	void ReleaseLockShared();
};

